var frmvalidator  = new Validator("Profiles");  
frmvalidator.addValidation("fName","req","Please enter your First Name");
frmvalidator.addValidation("lName","req","Please enter your Last Name");
frmvalidator.addValidation("gender","req","Please tell us your gender");
frmvalidator.addValidation("SIN","req","Please enter your social insurance number");
frmvalidator.addValidation("birthdate","req","Please tell us your birthday");
frmvalidator.addValidation("address","req","Please enter your address");
frmvalidator.addValidation("city","req","Please enter your living city");
frmvalidator.addValidation("mprovince","req","Please enter your living province");
frmvalidator.addValidation("postcode","req","Please enter your post code");
frmvalidator.addValidation("datein","req","Please tell us when did you move into this place");
frmvalidator.addValidation("primaryphone","req","Please provide your primary contact phone number so that we can reach you fast and easily");
frmvalidator.addValidation("workphone","req","Please enter your work phone number");
frmvalidator.setAddnlValidationFunction("cellphonefunction");
//frmvalidator.addValidation("cellphone","req","Please enter your First Name");


frmvalidator.addValidation("driver","req","Please enter your driver license, if you don't have one, please provide your health card number");
frmvalidator.addValidation("email","email","Please enter your email address and your email address will be your loginID when you come back, Thanks!");

frmvalidator.addValidation("cemail","eqelmnt=email","The confirmed email address is not the same as your email");
frmvalidator.addValidation("pwd","req","Please enter your password");
frmvalidator.addValidation("cpwd","eqelmnt=password","The confirmed password is not the same as your password");
frmvalidator.addValidation("r1name","req","Please enter your first reference Name");
frmvalidator.setAddnlValidationFunction("referencefunction");
//frmvalidator.addValidation("r2name","req","Please enter your second reference Name");
frmvalidator.addValidation("r1phone","req","Please enter your first reference phone number");
frmvalidator.setAddnlValidationFunction("refphonefunction");
//frmvalidator.addValidation("r2phone","req","Please enter your second reference phone number");
frmvalidator.addValidation("r1relation","req","Please tell us your relationship with your first reference");
frmvalidator.addValidation("advertisement","req","Please tell us where did you know www.cash2u.ca? Thanks.");


function cellphonefunction()  
{ 
var ch=document.forms["Profiles"]["cellphone"].value

  if(ch==null||ch="")  
  {  
cch=confirm("This is optional.  We recommend you provide your cell phone if you have. Please press cancel to provide one")
    sfm_show_error_msg('You don't want to provide your cell phone. Ok!');  
    return true;  
  }  
  else 
  {  
    return true;  
  }  
} 



function referencefunction()  
{ 
var r2=document.forms["Profiles"]["r2name"].value

  if(r2==null||r2="")  
  {  
r2h=confirm("This is optional.  We recommend you provide your second reference name. Please press cancel to provide one")
    sfm_show_error_msg('You don't want to provide your second reference. No problem!');  
    return true;  
  }  
  else 
  {  
    return true;  
  }  
} 

function refphonefunction()  
{ 
var r2h=document.forms["Profiles"]["r2phone"].value

  if(r2p==null||r2p="")  
  {  
r2hp=confirm("If you didn't provide your second reference name, you don't need to fill out this phone number. Please press ok, otherwise press cancel to provide one")
    sfm_show_error_msg('You didn't provide your second reference. please continue!');  
    return true;  
  }  
  else 
  {  
    return true;  
  }  
} 
